package v1

import (
	"github.com/gogf/gf/v2/frame/g"
)

// LoginReq 登录参数结构体
type LoginReq struct {
	g.Meta      `path:"/v1/membership/login" tags:"Membership" method:"post" summary:"登录" x-anonymous:"true"`
	Username    string `json:"username" v:"username @required#账号不能为空" dc:"账号"`
	Password    string `json:"password" v:"password @required#密码不能为空" dc:"密码"`
	DeviceType  int    `json:"deviceType" v:"deviceType @required#设备类型不能为空白" dc:"设备类型 1-pc 2-phone 3-pad 4-微信/支付宝小程序" default:"1"`
	CaptchaId   string `json:"captchaId" dc:"验证码Id"`
	CaptchaCode string `json:"captchaCode" dc:"验证码值"`
}

// LoginRes ... 登录返回消息结构体
type LoginRes struct {
	Type     string `json:"type" dc:"类型"`
	Token    string `json:"token" dc:"登录令牌"`
	ExpireIn int    `json:"expireIn" dc:"过期时间 单位秒"`
}

// RefreshTokenReq 刷新令牌 参数结构体
type RefreshTokenReq struct {
	g.Meta `path:"/v1/membership/refreshToken" tags:"Membership" method:"post" summary:"刷新token"`
}

// RefreshTokenRes 刷新令牌 返回消息结构体
type RefreshTokenRes struct {
	Token    string `json:"token" dc:"登录令牌"`
	ExpireIn int    `json:"expireIn" dc:"过期时间 单位秒"`
}
